package com.shiyi.shiyiaicodefather.ai;

import cn.hutool.ai.core.AIService;
import dev.langchain4j.model.chat.ChatModel;
import dev.langchain4j.service.AiServices;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AiCodeGenTypeRoutingServiceFactory {

  @Resource
  private ChatModel chatModel;

  @Bean
  public AiCodeGenTypeRoutingService aiCodeGenTypeRoutingService() {
    return AiServices.builder(AiCodeGenTypeRoutingService.class)
      .chatModel(chatModel)
      .build();
  }
}
